<?php

namespace App\Http\Controllers\admin;

use App\Http\Controllers\Controller;
use lxs\aliyun\OssStorage;
use lxs\api\ApiResponse;

class UploadController extends Controller
{


    /**
     * 本地上传
     */
    public function uploadsSubmit()
    {
        $file = request()->file('file');
        $path = request()->input('name');
        if (isset($path)) {
            $path = 'admin/' . $path;
        }
        $url = (new OssStorage())->Uploads($file, $path);

        return ApiResponse::apiResponseData(200, '获取图片数据成功', [
            'url' => $url
        ]);
    }


}
